package stu.day1_day8;

public class LeetCode1614 {
    public int maxDepth(String s) {
        int len = s.length();
        int num = 0;
        int max = 0;
        for(int i=0 ;i<len;i++){
            char m = s.charAt(i);
            if(m=='('){
                num += 1;
                max = num>max?num:max;
            }else if(m==')'){
                num -= 1;
            }
        }
        return max;

    }
}
